package entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import data.GenderEnum;

@Entity
@Table(name="STUDENTS")
@NamedQueries({
	@NamedQuery(name="Students.findAll", query="SELECT s FROM Students s"),
	@NamedQuery(name="Students.findByStudentId", query="SELECT s FROM Students s WHERE s.studentId = :studentId")
})
public class Students implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="STU_ID")
	private Long id;
	@Column(name="STU_STUDENT_ID", nullable=false, length=10, unique=true)
	private String studentId;
	@Column(name="STU_FIRST_NAME", nullable=false, length=20)
	private String firstName;
	@Column(name="STU_LAST_NAME", nullable=false, length=30)
	private String lastName;
	@Column(name="STU_GENDER", nullable=false)
	@Enumerated(EnumType.STRING)
	private GenderEnum gender;
	@Column(name="STU_PHONE", length=15)
	private String phone;
	@Column(name="STU_EMAIL", nullable=false, length=100, unique=true)
	private String email;
	@Column(name="STU_ADDRESS", length=200)
	private String address;
	
	public Students() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public GenderEnum getGender() {
		return gender;
	}

	public void setGender(GenderEnum gender) {
		this.gender = gender;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
   
}
